package com.yyy.controller;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yyy.model.User;

@RequestMapping("/springmvc")
@Controller
public class IndexController {
	
	@RequestMapping("index")
	public String index(@RequestParam(name="qwe",required=false) String name){
		System.out.println(name);
		return "index";
	}
	
	@RequestMapping("json")
	@ResponseBody
	public Object qwe(@RequestParam("name") String name,@RequestParam("password") String password){
		User user = new User();
		user.setName(name);
		user.setPassword(password);
		return user;
	}
	
}
